{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'address': '北京市景山前街4号',\n",
       " 'areaId': '642',\n",
       " 'areaName': '东城区',\n",
       " 'attention': 'A：故宫将自2014年1月1日起，除法定节假日和暑期（每年7月1日至8月31日）外，全年实行周一闭馆的措施。B：自2011年7月2日起，故宫博物院实行自南向北单向参观路线：午门（南门）只作为参观入口，观众一律从午门进入故宫；神武门（北门）只作为参观出口，观众参观结束后一律由神武门离开故宫。C：北京故宫只能刷身份证入园，预订日期当天携带好身份证到景区刷身份证入园。（因二代身份证丢失或损坏无法检票的，可凭预售登记的身份证号到指定售票窗口补领纸质门票检票进门）D：如遇景区电子票验证通道检修，需要客人配合到指定窗口换取验票凭证入园，敬请谅解！E：门票当天有效，出园需入园，需再次购票F：身份证实名的产品，请填写真实姓名和身份证号，不然无法顺利入园。预订必读1、北京故宫2015.6.1日开启式施行一个有效证件每个入院日只能订一张票，且一个证件单个入院日所预订的所有订单必须统一验证入院，不得分批次验证入院。超过1人请提供多张有效身份证分批次下单购买！同一有效身份证在同一出游日只能下单一次，请勿多次下单。\\r\\n2、故宫预售门票一经出售一概不退不换不改期！即您的参观日期确定提交后无法修改。如行程因客观原因不得不变更，需修改或取消订单，需收取订单金额100%的票券损失费。3、必须在出游日前1天的15：00前下单，电子码信息在出游日前两天发送到客户手机上。4.故宫内不得吸烟！5、北京故宫因反法西斯战争胜利70周年，周边管制要求于8.22-9.3日暂时闭馆，请您提前做好行程安排，若给您还来不便请谅解，谢谢。活动提醒1.预订日期当天携带好身份证到景区刷身份证入园①老年人入园需出示身份证和老年证.②学生入园需出示学生证.2.★在线咨询QQ群②：（此QQ群为驴友自发旅游经验分享群，不代表同程网官方）',\n",
       " 'cityId': '0',\n",
       " 'content': '故宫有四个门，正门名为午门。午门有五个洞。其平面为凹形，宏伟壮丽。午门后有五座精巧的汉白玉拱桥通往太和门。东门名东华门，西门名西华门，北门名神武门。故宫的四个城角都有精巧玲珑的角楼，角楼高27.5米，十字屋脊，三重檐迭出，四面亮山，多角交错，是结构奇丽的建筑。正门午门，俗称五凤楼。午门是皇帝下诏书、下令出征的地方。每遇宣读皇帝圣旨，颁发年历书，文武百官都要齐集午门前广场听旨。午门当中的正门平时只有皇帝才可以出入，皇帝大婚时皇后进一次，殿试考中状元、榜眼、探花的三人可以从此门走出一次。文武大臣进出东侧门，宗室王公出入西侧门。后门神武门，明朝时为玄武门，清康熙年间因避讳改称神武门。神武门也是一座城门楼形式，用的最高等级的重檐庑殿式屋顶，但它的大殿只有五开间加围廊，没有左右向前伸展的两翼，所以在形制上要比午门低一个等级。神武门是宫内日常出入的门禁。现神武门为故宫博物院正门。 东华门与西华门遥相对应，门外设有下马碑石，门内金水河南北流向，上架石桥1座，桥北为三座门。皇帝死后其灵柩就从东华门运出，故俗称鬼门。太和门，在午门以内，有广阔的大庭院，当中有弧形的内金水河横亘东西，北面就是外朝宫殿大门&mdash;&mdash;太和门，左右各有朝房、廊庑。金水河上有5座桥梁，装有白色汉白玉栏杆，随河宛转，形似玉带。 风景图 风景图故宫建筑的后半部叫内廷，是皇帝及嫔妃生活娱乐的地方。前朝与内廷宫殿的分界线乾清门，乾清门以南为前朝，以北为内廷。乾清门左右有琉璃照壁，是清朝御门听政的所在地。太和门和乾清门都是殿的形式，虽然名字上是门，在明代皇帝上朝处理政事都是在太和门，清代的时候皇帝上朝处理政事才改到乾清门。内廷以乾清宫、交泰殿、坤宁宫为中心，东西两翼有东六宫和西六宫，是皇帝处理日常政务之处也是皇帝与后妃居住生活的地方。后半部在建筑风格上同于前半部。前半部建筑形象是严肃、庄严、壮丽、雄伟，以象征皇帝的至高无上。后半部内廷则富有生活气息，建筑多是自成院落，有花园、书斋、馆榭、山石等。内廷东侧的宁寿宫是当年乾隆皇帝宣布退位后当太上皇养老皇宫，花费一百一十万两银修建。 风景图 风景图故宫这样宏伟的建筑，如此浩大的工程，由谁负责设计？又是谁主持施工的？这的确是个历史谜团，难倒不少老北京人。因为故宫的建筑上没有如现代建筑那样明确地刻上此建筑物建于何年，由何人设计等字样。目前大多数人都认为故宫是明代一位杰出的匠师，姓蒯名祥，人称蒯鲁班的人设计的。故宫博物院古建部高级工程师于倬云先生提出了不同意见：曾经参加建造南京宫殿的蒯祥是故宫的设计者这个说法不确切，其实，蒯祥只是故宫的施工主持人，故宫真正的设计人应该是名不见经传的蔡信。永乐15年紫禁城宫殿开始进入大规模施工高潮时，蒯祥才随朱棣从南京来到北京，开始主持宫殿的施工，而在此之前，蔡信已主持故宫和北京城的规划、设计和建造了。 风景图 风景图',\n",
       " 'coupon': '学生：大学、高中、初中、小学学生持国外学生证除外（含港、澳、台学生；不含成人教育、研究生），可凭学生证购买学生票。小学学生若没有学生证，可根据预定时填写的身份证兑换纸质票。老人：60岁以上（包括60岁）老年人凭有效证件，门票半价优惠。离休干部：离休干部凭离休证免费参观。残疾人：残疾人凭残疾人证件免费参观。儿童：身高1.2米(含)以下儿童可以随监护人免票参观。',\n",
       " 'ct': '2020-05-06 22:23:49.079',\n",
       " 'id': '3007',\n",
       " 'location': {'lat': '39.92353999', 'lon': '116.40343283'},\n",
       " 'name': '北京故宫',\n",
       " 'opentime': '售票时间：08:30--15:30停止入馆时间：15:40清场时间：16:30除法定节假日和暑期（每年7月1日至8月31日）外，全年实行周一全天闭馆的措施。',\n",
       " 'picList': [{'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAIE49AAG4uVc17aM381.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAIE49AAG4uVc17aM381_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAbWJ4AAO9IG8_Iv4217.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAbWJ4AAO9IG8_Iv4217_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RaAMo2lAAIxQCdPeIE381.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RaAMo2lAAIxQCdPeIE381_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAfNooAANVcqKJRfQ883.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAfNooAANVcqKJRfQ883_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ReAZM8vAALofFW-Zqk446.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ReAZM8vAALofFW-Zqk446_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAd_ETAAHvZtzLLXk401.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAd_ETAAHvZtzLLXk401_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RiAT0UAAAKnB816bkk086.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RiAT0UAAAKnB816bkk086_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAWf9SAAKkEsFr2iU141.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReAWf9SAAKkEsFr2iU141_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RiAZP1SAALTp5-JfoM731.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RiAZP1SAALTp5-JfoM731_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ReAFwZ9AAJeUMY29vk811.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ReAFwZ9AAJeUMY29vk811_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReASJlAAAJwiKc1Ugg187.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ReASJlAAAJwiKc1Ugg187_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RiAGDmsAAIP8dv7icQ314.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RiAGDmsAAIP8dv7icQ314_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaABIJwAAHfiTXx2w0712.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaABIJwAAHfiTXx2w0712_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaASze9AAJGwa_WzL8701.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaASze9AAJGwa_WzL8701_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RaAc8_zAAE2vbvLpFo594.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RaAc8_zAAE2vbvLpFo594_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaARNe7AAMAO1N0UMc639.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaARNe7AAMAO1N0UMc639_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaAH0A4AAKo88dJ0fU948.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RaAH0A4AAKo88dJ0fU948_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RWASi7HAAL07m9t0MQ039.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RWASi7HAAL07m9t0MQ039_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RWAan-pAAHemHiyBvs657.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RWAan-pAAHemHiyBvs657_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAEAPMAAFdKKcx8Zc661.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAEAPMAAFdKKcx8Zc661_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RiAKf1YAAO9xrNPtzY297.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RiAKf1YAAO9xrNPtzY297_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAY5tUAAGkhbP4I8I982.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAY5tUAAGkhbP4I8I982_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAf1NiAAFYq1piPWQ035.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RWAf1NiAAFYq1piPWQ035_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RSAKja4AAFIdcP9WwY294.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RSAKja4AAFIdcP9WwY294_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSARp4GAAMDN1fYbWg418.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSARp4GAAMDN1fYbWg418_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAJeMoAACTVDNwdOo978.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAJeMoAACTVDNwdOo978_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAbTyaAASa7u5c0r0706.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAbTyaAASa7u5c0r0706_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-iCANmTGAAIjlsCz9UU882.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-iCANmTGAAIjlsCz9UU882_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAZCmYAALUe6sYVbA585.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAZCmYAALUe6sYVbA585_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RSAJVuZAAGwJvt37io907.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-RSAJVuZAAGwJvt37io907_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAKMb_AAGMMNgS-G4494.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-RSAKMb_AAGMMNgS-G4494_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-iCAUtWGAAF9GqtAC5M464.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-iCAUtWGAAF9GqtAC5M464_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAeLZdAAMVy4Xm-U8391.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAeLZdAAMVy4Xm-U8391_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-h-AMi6dAAOHjTzee9c053.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/85/rBANB1x9-h-AMi6dAAOHjTzee9c053_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ROAcsY5AAFEKqovZVM075.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ROAcsY5AAFEKqovZVM075_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ROAaigkAALrZ-Z2ZMQ664.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/71/rBANB1x9-ROAaigkAALrZ-Z2ZMQ664_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/65/b2/rBANB1x9_HSAXM-UAANuVlZ8Kd8188.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/65/b2/rBANB1x9_HSAXM-UAANuVlZ8Kd8188_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAH_-3AAK1Fwdpvu8494.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAH_-3AAK1Fwdpvu8494_130x130_00.jpg'},\n",
       "  {'picUrl': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAen8dAALtVzB4JQQ382.jpg',\n",
       "   'picUrlSmall': 'http://pic5.40017.cn/03/000/dd/48/rB5oQFx9-ROAen8dAALtVzB4JQQ382_130x130_00.jpg'}],\n",
       " 'priceList': [],\n",
       " 'proId': '3',\n",
       " 'proName': '北京',\n",
       " 'star': '5A',\n",
       " 'summary': '世界上现存规模最大、保存最完整的帝王宫殿'}"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 全国景点查询\n",
    "#运行本代码需要下载SDK包获取ShowapiRequest模块\n",
    "\n",
    "from ShowapiRequest import ShowapiRequest\n",
    "import pandas as pd\n",
    "\n",
    "r = ShowapiRequest(\"http://route.showapi.com/268-1\",\"521349\",\"3eb3f2d0dec24d30adb03c90905b3410\" )\n",
    "r.addBodyPara(\"keyword\", \"北京故宫\")\n",
    "r.addBodyPara(\"proId\", \"\")\n",
    "r.addBodyPara(\"cityId\", \"\")\n",
    "r.addBodyPara(\"areaId\", \"\")\n",
    "r.addBodyPara(\"page\", \"\")\n",
    "# r.addFilePara(\"img\", r\"C:\\Users\\showa\\Desktop\\使用过的\\4.png\") #文件上传时设置\n",
    "res = r.post()\n",
    "# print(res.json) \n",
    "res.json()[ 'showapi_res_body'][ 'pagebean']['contentlist'][1]# 返回信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>address</th>\n",
       "      <th>areaId</th>\n",
       "      <th>areaName</th>\n",
       "      <th>attention</th>\n",
       "      <th>cityId</th>\n",
       "      <th>content</th>\n",
       "      <th>coupon</th>\n",
       "      <th>ct</th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>opentime</th>\n",
       "      <th>picList</th>\n",
       "      <th>priceList</th>\n",
       "      <th>proId</th>\n",
       "      <th>proName</th>\n",
       "      <th>star</th>\n",
       "      <th>summary</th>\n",
       "      <th>location.lat</th>\n",
       "      <th>location.lon</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北京市景山前街4号</td>\n",
       "      <td>642</td>\n",
       "      <td>东城区</td>\n",
       "      <td>A：故宫将自2014年1月1日起，除法定节假日和暑期（每年7月1日至8月31日）外，全年实行...</td>\n",
       "      <td>0</td>\n",
       "      <td>故宫有四个门，正门名为午门。午门有五个洞。其平面为凹形，宏伟壮丽。午门后有五座精巧的汉白玉拱...</td>\n",
       "      <td>学生：大学、高中、初中、小学学生持国外学生证除外（含港、澳、台学生；不含成人教育、研究生），...</td>\n",
       "      <td>2020-05-06 22:23:49.079</td>\n",
       "      <td>3007</td>\n",
       "      <td>北京故宫</td>\n",
       "      <td>售票时间：08:30--15:30停止入馆时间：15:40清场时间：16:30除法定节假日和...</td>\n",
       "      <td>[{'picUrl': 'http://pic5.40017.cn/03/000/dd/48...</td>\n",
       "      <td>[]</td>\n",
       "      <td>3</td>\n",
       "      <td>北京</td>\n",
       "      <td>5A</td>\n",
       "      <td>世界上现存规模最大、保存最完整的帝王宫殿</td>\n",
       "      <td>39.92353999</td>\n",
       "      <td>116.40343283</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     address areaId areaName  \\\n",
       "0  北京市景山前街4号    642      东城区   \n",
       "\n",
       "                                           attention cityId  \\\n",
       "0  A：故宫将自2014年1月1日起，除法定节假日和暑期（每年7月1日至8月31日）外，全年实行...      0   \n",
       "\n",
       "                                             content  \\\n",
       "0  故宫有四个门，正门名为午门。午门有五个洞。其平面为凹形，宏伟壮丽。午门后有五座精巧的汉白玉拱...   \n",
       "\n",
       "                                              coupon                       ct  \\\n",
       "0  学生：大学、高中、初中、小学学生持国外学生证除外（含港、澳、台学生；不含成人教育、研究生），...  2020-05-06 22:23:49.079   \n",
       "\n",
       "     id  name                                           opentime  \\\n",
       "0  3007  北京故宫  售票时间：08:30--15:30停止入馆时间：15:40清场时间：16:30除法定节假日和...   \n",
       "\n",
       "                                             picList priceList proId proName  \\\n",
       "0  [{'picUrl': 'http://pic5.40017.cn/03/000/dd/48...        []     3      北京   \n",
       "\n",
       "  star               summary location.lat  location.lon  \n",
       "0   5A  世界上现存规模最大、保存最完整的帝王宫殿  39.92353999  116.40343283  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(res.json()[ 'showapi_res_body'][ 'pagebean']['contentlist'][1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': 'B0FFFPCYKW',\n",
       " 'name': '鸳鸯湖',\n",
       " 'district': '广东省阳江市江城区',\n",
       " 'adcode': '441702',\n",
       " 'location': '111.992970,21.852860',\n",
       " 'address': [],\n",
       " 'typecode': '190204',\n",
       " 'city': []}"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 输入提示\n",
    "\n",
    "import requests\n",
    "huang_key=\"f9c67660b4fb5495dbf50ab796f74b1e\"\n",
    "input_tips_url = \"https://restapi.amap.com/v3/assistant/inputtips?parameters\"\n",
    "keyword=\"鸳鸯湖\"\n",
    "city=\"阳江市\"\n",
    "params = {\n",
    "        \"key\": huang_key,\n",
    "        \"keywords\": keyword,\n",
    "        \"output\": \"json\",\n",
    "    }\n",
    "r = requests.get(input_tips_url, params)\n",
    "r.json()['tips'][0]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
